#include<stdio.h> 
#include<stdlib.h> 
#define MAXVERTEXNUM 1001
typedef int Vertex;
typedef struct AdjVNode* PtrToAdjVNode;
struct AdjVNode{
	Vertex Adj;
	PtrToAdjVNode Next;
};
typedef struct HNode{
	PtrToAdjVNode FirstAdjVNode;
}AdjList[MAXVERTEXNUM];
typedef struct GNode* LGraph;
struct GNode{
	int VertexNum;
	int EdgeNum;
	AdjList GList;
};
struct ENode{
	Vertex V;
	Vertex W;
};
typedef struct ENode* Edge;
LGraph CreatGraph(int N)
{
	LGraph G=(LGraph)malloc(sizeof(struct GNode));
	G->VertexNum=N;
	G->EdgeNum=0;
	int i;
	for(i=1;i<N;i++){
	    G->GList[i].FirstAdjVNode=NULL; 
	}
	return G;
}
void Insert(LGraph Graph,Edge L)
{
	PtrToAdjVNode VNode=(PtrToAdjVNode)malloc(sizeof(struct AdjVNode));
	VNode->Adj=L->W;
	VNode->Next=Graph->GList[L->V].FirstAdjVNode;
	Graph->GList[L->V].FirstAdjVNode=VNode;
	PtrToAdjVNode WNode=(PtrToAdjVNode)malloc(sizeof(struct AdjVNode));
	WNode->Adj=L->V;
	WNode->Next=Graph->GList[L->W].FirstAdjVNode;
	Graph->GList[L->W].FirstAdjVNode=WNode;
}
void BuildGraph(LGraph Graph,int edgeNum)
{
	int i;
	Graph->EdgeNum=edgeNum;
	Edge L=(Edge)malloc(sizeof(struct ENode));
	for(i=0;i<edgeNum;i++){
	    scanf("%d%d",&(L->V),&(L->W));
	    Insert(Graph,L);
	}
}		

int BFS(LGraph G,Vertex V)
{
	int *visited=(int*)malloc(sizeof(int)*(G->VertexNum+1));
	int i,j;
	for(i=0;i<=G->VertexNum;i++){
	    visited[i]=0;
	}
	int *queue=(int*)malloc(sizeof(int)*(G->VertexNum));
	int rear=-1,head=-1;
	int level=0,last=V,tail=0;
	int count=1;
	visited[V]=1;
	queue[++rear]=V;
	while(rear>head){
	    V=queue[++head];
	    PtrToAdjVNode W=G->GList[V].FirstAdjVNode;
	    for(;W;W=W->Next){
	        if(visited[W->Adj]==0){
	            count++;
	            visited[W->Adj]=1;
	            queue[++rear]=W->Adj;
	            tail=W->Adj;
	        }
	    }
	    if(V==last){
	        level++;
	        last=tail;
	    }
	    if(level==6)break;
	} 
	free(visited);
	free(queue);
	return count;
}
void SixDegreesSeparation(LGraph G)
{
	Vertex i=1;
	int count=0;
	for(i=1;i<=G->VertexNum;i++){
	    count=BFS(G,i);
	    printf("%d: %.2lf%%\n",i,count*100.0/G->VertexNum);
	}
}

int main()
{	
	int N,E;
	scanf("%d%d",&N,&E);
	LGraph G=CreatGraph(N);
	BuildGraph(G,E);
	SixDegreesSeparation(G);
	return 0;
}
		